/*
 * @Description  :
 * @Version      : 0.1
 * @Company      : V-Think Development Team
 * @Author       : KiraVerSace@yeah.net
 * @Date         : 2022-05-17 17:18:52
 * @LastEditTime : 2022-11-28 17:01:48
 */
#ifndef __X_META_DATA_H__
#define __X_META_DATA_H__

#include <xCommon.h>

typedef struct
{
    uint8_t  address[5];
    uint16_t hardwareCode;

    uint8_t  linkProtocol;          // 协议 LP_MQTT=1/LP_TCP=2/LP_UDP=3
    uint8_t  linkIP[32];
	uint16_t linkPort;

    uint8_t  tcProjectKey [32];		// ThingsCloud的链接参数 [ProjectKey&AccessToken]
	uint8_t  tcAccessToken[32];

    uint8_t  reserveArray[128];

    uint16_t crc16;					// CITT Must in the last
}__attribute__((packed)) XReadOnlyAreaT;
extern XReadOnlyAreaT xReadOnlyArea;

/**
 * @brief 初始化一些保证数据为原子操作的互斥量
 * 该函数在xFram.cpp中被调用
 */
extern void xMetaDataInit(void);

#endif
